﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Xml.Linq;
using EFFC.Net.Resource;
using EFFC.Net.Data.Base;
using EFFC.Net.Common;

namespace EFFC.Net.BatchBuilder.Public
{
    public class BatchConfigString
    {
        /// <summary>
        /// DB連接串
        /// </summary>
        public static string DBConn
        {
            get
            {
                string conn = MyConfig.GetWebDBConnStringByEncrypt("dbConn");
                if (string.IsNullOrEmpty(conn))
                {
                    conn = MyConfig.GetDBConnStringByEncrypt("dbConn");
                }
                return conn;
            }
        }
        /// <summary>
        /// 每頁顯示最大資料筆數
        /// </summary>
        public static int PageSize
        {
            get { return 1000; }
        }

        public static bool DebugMode
        {
            get { return bool.Parse(MyConfig.GetConfiguration("DebugMode")); }
        }

        public static string XMLPath
        {
            get { return MyConfig.GetConfiguration("XMLPath"); }
        }

        public static string XSDPath
        {
            get { return MyConfig.GetConfiguration("XSDPath"); }
        }

        public static string ServerIP
        {
            get { return MyConfig.GetConfiguration("ServerIP"); }
        }

        public static string PortNO
        {
            get { return MyConfig.GetConfiguration("PortNO"); }
        }

        public static string SysId
        {
            get { return MyConfig.GetConfiguration("SysId"); }
        }

        public static string SrcAddress
        {
            get { return MyConfig.GetConfiguration("SrcAddress"); }
        }

        /// <summary>
        /// UMSWinService启动周期，单位为秒
        /// </summary>
        public static int StartCycle
        {
            get { return IntStd.ParseStd(MyConfig.GetConfiguration("ServiceStartCycle")).Value; }
        }
        /// <summary>
        /// 可执行序号
        /// </summary>
        public static string ExcuteNo
        {
            get { return MyConfig.GetConfiguration("ExcuteNo"); }
        }

        /// <summary>
        /// 發件人地址
        /// </summary>
        public static string EmailFrom
        {
            get { return MyConfig.GetConfiguration("EmailFrom"); }
        }

        /// <summary>
        /// Email服務IP
        /// </summary>
        public static string EmailServerIp
        {
            get { return MyConfig.GetConfiguration("EmailServerIp"); }
        }

        /// <summary>
        /// 附件存放目錄
        /// </summary>
        public static string AttachPath
        {
            get { return MyConfig.GetConfiguration("AttachPath"); }
        }

        
        /// <summary>
        /// SFTP傳輸本地Client_RootDir目錄
        /// </summary>
        public static string Client_RootDir
        {
            get { return MyConfig.GetConfiguration("Client_RootDir"); }
        }

        /// <summary>
        /// SFTP傳輸本地Backup目錄
        /// </summary>
        public static string Client_Backup
        {
            get { return MyConfig.GetConfiguration("Client_Backup"); }
        }

        /// <summary>
        /// SFTP傳輸本地臨時目錄
        /// </summary>
        public static string Client_Temp
        {
            get { return MyConfig.GetConfiguration("Client_Temp"); }
        }

        /// <summary>
        /// SFTP傳輸Server Backup目錄
        /// </summary>
        public static string Server_Backup
        {
            get { return MyConfig.GetConfiguration("Server_Backup"); }
        }

        /// <summary>
        /// SFTP傳輸Server RootDir目錄
        /// </summary>
        public static string Server_RootDir
        {
            get { return MyConfig.GetConfiguration("Server_RootDir"); }
        }

        public static string SFTP_ServerName
        {
            get { return MyConfig.GetConfiguration("SFTP_ServerName"); }
        }

        /// <summary>
        /// 傳真附件存放目錄
        /// </summary>
        public static string FaxPath
        {
            get { return MyConfig.GetConfiguration("FaxPath"); }
        }

        /// <summary>
        /// 處理碼
        /// </summary>
        public static string ActionCode
        {
            get { return MyConfig.GetConfiguration("ActionCode"); }
        }


        /// <summary>
        /// 列印檔案存放目錄路徑
        /// </summary>
        public static string PrintFilePath
        {
            get { return MyConfig.GetConfiguration("PrintFilePath"); }
        }

        /// <summary>
        /// 列印處理碼(印表設備名稱ID)
        /// </summary>
        public static string PrintActionCode
        {
            get { return MyConfig.GetConfiguration("ActionCode"); }
        }

        /// <summary>
        /// FaxServerDB連接串
        /// </summary>
        public static string FaxServerConn
        {
            get
            {
                string conn = MyConfig.GetWebDBConnStringByEncrypt("FaxServerConn");
                if (string.IsNullOrEmpty(conn))
                {
                    conn = MyConfig.GetDBConnStringByEncrypt("FaxServerConn");
                }
                return conn;
            }
        }

        /// <summary>
        /// WinScp路徑
        /// </summary>
        public static string WinScp_path 
        {
            get { return MyConfig.GetConfiguration("WinScp_Path"); }
        }

        /// <summary>
        /// SFTP_PassWord
        /// </summary>
        public static string SFTP_Password
        {
            get { return MyConfig.GetConfiguration("SFTP_Password"); }
        }

        /// <summary>
        /// 本机Call_Center_ID
        /// </summary>
        public static string Clien_CallCenterID
        {
            get { return MyConfig.GetConfiguration("Clien_CallCenterID"); }
        }

        public static string end_call_center_serial_no 
        {
            get{ return MyConfig.GetConfiguration("end_call_center_serial_no"); }
        }

        public static string sshhostkey
        {
            get { return MyConfig.GetConfiguration("sshhostkey"); }
        }
    }

}
